<template>
    <el-dialog
        title="核销信息"
        :visible.sync="showValue"
        append-to-body
        :close-on-click-modal="false"
        width="1300px"
        top="30px"
        :close="clearData"
        :before-close="clearData"
    >
        <div class="wrap">
            <el-table
                :header-cell-style="headerCellStyle"
                :data="form.borrowPosVerificationResponses"
                size="small"
                max-height="350px"
            >
                <el-table-column
                    prop="enterpriseDept"
                    label="事业部"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="dept"
                    label="部门"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    width="200"
                    prop="productNo"
                    label="产品料号"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="productName"
                    width="200"
                    label="产品名称"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="orderCode"
                    label="销售订单单号"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>

                <el-table-column
                    prop="applyAdminCode"
                    label="核销申请人工号"
                    show-overflow-tooltip
                    width="200"
                ></el-table-column>
                <el-table-column
                    prop="applyAdminName"
                    label="核销申请人名称"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="applyTimeStr"
                    label="核销申请时间"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="verificationCode"
                    width="200"
                    label="核销编号"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="verificationType"
                    label="核销方式"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="applyVerification"
                    label="申请核销"
                    show-overflow-tooltip
                    width="200"
                ></el-table-column>
                <el-table-column
                    prop="canVerification"
                    width="200"
                    label="可核销"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="verificationLendApprove"
                    width="200"
                    label="核销转借在审"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="editAdminName"
                    width="200"
                    label="填写人名称"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="editAdminCode"
                    width="200"
                    label="填写人工号"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="approveStatus"
                    label="审批状态"
                    width="200"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="step"
                    width="200"
                    label="步骤"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    prop="remarks"
                    width="200"
                    label="备注"
                    show-overflow-tooltip
                ></el-table-column>
            </el-table>
        </div>
    </el-dialog>
</template>

<script>
export default {
    props: {
        value: Boolean,
        currRow: Object
    },
    data () {
        return {
            showValue: false,
            form: {
            }
        }
    },
    watch: {
        value (val) {
            this.showValue = val
        },
        showValue (val) {
            this.$emit('update:value', val)
            if (val) {
                this.getDetail()
            }
        }
    },
    created () {
    },
    methods: {
        // 获取列表
        async getDetail () {
            const res = await this.$http.get(this.$store.state.IP + '/borrowDevice/borrowPosDetail?id=' + this.currRow.id, {
            })
            let response = res.data
            if (response.ret === '0') {
                this.form = response.res
            }
        },
        // 清空数据
        clearData () {
            this.currentPage = 1
            this.showValue = false
            this.form = {}
        }
    }
}
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
.item
    width: 110px

.right
    text-align: right

.wrap
    max-height: 500px
    overflow: auto
    padding: 20px

.formItem
    word-wrap: break-word
    width: 400px
</style>